def basename filename; filename[0..-5];end
def i_file filename; File.new("/Users/forrestc/images/#{filename}"); end
def create_image (filename); unless filename =~ /^\./; Image.create :title=>basename(filename),:filename=>i_file(filename); end;end
def cp filename; puts filename if create_image(filename); end
Dir.new('/Users/forrestc/images').each {|filename| cp filename}
